//判断是PC端还是移动端

//修改
function IsPC() {  
   var userAgentInfo = navigator.userAgent;  
   var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");  
   var flag = true;
   for (var v = 0; v < Agents.length; v++) {
       if (userAgentInfo.indexOf(Agents[v]) > 0) {
       	flag = false;
       	break;
       }
   }
   return flag;
}
if (IsPC()) {
	$("#wrap").width = 375;
	$("#wrap").height = 627;
}else{
	$("#wrap").width = document.documentElement.clientWidth;
	$("#wrap").height = document.documentElement.clientHeight;
}
var cW = $("#wrap").width;
var cH = $("#wrap").height;



//背景音乐点击暂停、播放
		var music = document.getElementById("bgMusic");
	    $("#audioBtn").click(function(){
		    if(music.paused){
		    		music.play();
		    		$("#m1").css("display","block");
				$("#m2").css("display","none");
		   		$("#audioBtn").removeClass("pause").addClass("play");
		    }else{
		    		music.pause();
		    		$("#m2").css("display","block");
				$("#m1").css("display","none");
		    		$("#audioBtn").removeClass("play").addClass("pause");
		    }
		});



setTimeout(function(){
	$(".box_one").css("display","none");
	$(".box_two").css("display","block");
},1000);

//文字介绍一行一行出现然后消失
var index = 0;
var timer_news = setInterval(function(){
	if (index >= $("ul>li").length){
		clearInterval(timer_news);
		$("ul").css("display","none");
	} else{
		$("ul>li").eq(index).show();
		index++;
//		console.log($("ul>li").eq(index));
	}
},1000);

setTimeout(function(){
	$(".box_one").css("display","none");
	$(".box_two").css("display","none");
	$(".box_three").css("display","block");
	
},17000)
setTimeout(function(){
	$(".box_one").css("display","none");
	$(".box_two").css("display","none");
	$(".box_three").css("display","none");
	$(".box_four").css("display","block");
},25000)


$("#btn").on("click",function(){
	window.location.href = "http://127.0.0.1:8020/%E6%89%BE%E5%BE%90%E5%B3%A5/game.html";
})
//斗篷飞起来
//function haha(){
//		 var i=0
//		 var z=3; //图片总数
//	     var demo=$("#demo img");
//		setInterval(function(){
//		   if(i==z){i=0}
//		   demo.eq(i).show().siblings().hide();	
//		   i++;
//	    },100)		 	 	
//}
//haha();














////让文字一个一个显示出来
//var index=0;
//var word=document.getElementById("w").innerHTML;
//function type(){
//  document.getElementById("aa").innerText = word.substring(0,index++);
//}
//setInterval(type, 50);